<template>
	<scroll-view scroll-y="true" class="category_wrap">
		<view class="category_img">
		
				<navigator v-for="(item,index) in categroy" :key="item.id" :url="`../category/index?id=${item.id}`">
					<image :src="item.cover" mode="aspectFill"></image>
					<view class="text">
						{{item.name}}
					</view>
				</navigator>
			
		</view>
	</scroll-view>
</template>

<script>
	import request from '../../../JS/request.js'
	export default{
			data(){
				return{
				
					categroy:[]
					
				}
			},
			methods:{
			async getList(){
				let categroy = await request({
					url:'http://service.picasso.adesk.com/v1/vertical/category',
					
				})	
				this.categroy = categroy.data.res.category
			
				},
				imgo(item){
					console.log(item)
				}
			},
			mounted() {
				wx.setNavigationBarTitle({
					title:"分类"
				})
				this.getList()
				
			}
			
	}
</script>

<style lang="scss">
	.category_wrap{
		height: calc(100vh - 36px);
		.category_img{
			display: flex;
			flex-wrap: wrap;
			navigator{
				display: block;
				position: relative;
				width: 32%;
				padding: 5rpx;
				image{
					height: 200rpx;
				}
				.text{
					position: absolute;
					left: 15rpx;
					bottom: 15rpx;
					
					color: #FFFFFF;
					font-weight: bold;
					font-size: 30rpx;
				}
			}
		}
	}
</style>
